package com.anhry.www.safety.util;
//package com.anhry.www.safety.util;
//
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
//import javax.annotation.PostConstruct;
//import javax.annotation.Resource;
//import org.apache.log4j.Logger;
//import org.springframework.context.annotation.Scope;
//import org.springframework.stereotype.Component;
//
//import com.anhry.www.safety.manage.enterprise.service.CorpEconomyTypeService;
//import com.anhry.www.safety.manage.enterprise.service.CorpTypeService;
//import com.anhry.www.safety.manage.system.service.UserService;
//
//@Component
//@Scope("singleton")
//@SuppressWarnings("unchecked")
//public class DataDictionaryHolder {
//	
//	/*//属地一级列表信息
//	public static final String DISTRICTS_LEVEL_ONE = "districts";
//	//行业列表信息
//	public static final String INDUSTRIES = "industries";*/
//	//全部行业信息列表
//	public static final String INDUSTRIES_ALL = "industries_all";
//	//企业类型一级列表信息
//	public static final String ENTERPRISE_TYPES_LEVEL_ONE = "enterprise_types";
//	//企业国民经济分类一级列表
//	public static final String ECONOMIC_TYPES_LEVEL_ONE = "economic_types";
//	//用户级别列表
//	public static final String USER_GRADES = "user_grades";
//	
//	private static Map<String, List> dataDictionary = new HashMap<String, List>();
//
//	private Logger logger = Logger.getLogger(DataDictionaryHolder.class);
//	
//	@Resource
//	private CorpTypeService corpTypeService;
//	@Resource
//	private CorpEconomyTypeService corpEconomyTypeService;
//	@Resource
//	private UserService userService;
//	
//	/**
//	 * 在用户登录的时候对数据进行初始化 
//	 * @param user
//	 */
//	@PostConstruct
//	public void init() {
//		try {
//			if(dataDictionary.size() == 0) {
//				dataDictionary.put(ENTERPRISE_TYPES_LEVEL_ONE, corpTypeService.getLevel1CorpTypeList());
//				dataDictionary.put(ECONOMIC_TYPES_LEVEL_ONE, corpEconomyTypeService.getCorpEconomyTypeList());
//				dataDictionary.put(INDUSTRIES_ALL, corpTypeService.getUnitList());
//				dataDictionary.put(USER_GRADES, userService.getUserGrade());
//				
//				if(logger.isDebugEnabled()) {
//					logger.debug("初始化 企业类别一级列表, 属地一级列表, 行业信息列表 成功.");
//				}
//				
//				emptyServices();
//			}
//		} catch (Exception e) {
//			logger.error(e.getMessage());
//			e.printStackTrace();
//		}
//	}
//	
//	private void emptyServices() {
//		this.setCorpEconomyTypeService(null);
//		this.setCorpTypeService(null);
//		this.setUserService(null);
//	}
//	public static List getDictionary(String key) {
//		return dataDictionary.get(key);
//	}
//
//	public void setCorpTypeService(CorpTypeService corpTypeService) {
//		this.corpTypeService = corpTypeService;
//	}
//	public void setCorpEconomyTypeService(
//			CorpEconomyTypeService corpEconomyTypeService) {
//		this.corpEconomyTypeService = corpEconomyTypeService;
//	}
//
//	public void setUserService(UserService userService) {
//		this.userService = userService;
//	}
//	
//}
